一般地MySQL安装在
/usr/local/mysql/
通过以下命令链接到mysql客户端:
mysql [-u username] [-h host] [-p[password]] [dbname]
./mysql -uroot -h172.22.23.1 -p123456 -P3306
show databases
show tables
use table
查看表信息
查看某一个库所有表的详细信息:
1 | use information_schema; |
1 | use information_schema; |
1 | desc table; |
修改表字段,注释
1 | alter table t comment = '表注释'; |
查看MySQL DDL
1 | show create table table_name\G; |